﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using System.Web;
using System.Text;

namespace Viewdoxx3.VisualWebPart1
{
    public partial class VisualWebPart1UserControl : UserControl
    {

        enum Viewdoxx
        {
            None,
            Projekte,
            Kunden,
            Prozesse,
            Produkte,
        };

        public enum DokumentKategorie
        {
            Marketing,
            Produktion,
            Projekt,
            Qualitaet
        }

        private static SPWeb web;
        private static SPList list;
        private static SPQuery query;
        private static ListViewByQuery lvbq;
        private Viewdoxx viewdoxx;
        private string myQuery;
        
        #region attribute image url
        private const string url_viewgle_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_grau.png";
        private const string url_produkt_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_produkte_grau.png";
        private const string url_prozess_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_prozesse_grau.png";
        private const string url_kunde_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_kunden_grau.png";
        private const string url_projekte_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_grau.png";
        private const string url_viewgle_auf = "~/_layouts/images/Viewdoxx3/viewdoorskachel_grau_auf.png";
        private const string url_produkt_auf = "~/_layouts/images/Viewdoxx3/viewdoorskachel_produkte_auf.png";
        private const string url_prozess_auf = "~/_layouts/images/Viewdoxx3/viewdoorskachel_prozesse_auf.png";
        private const string url_kunde_auf = "~/_layouts/images/Viewdoxx3/viewdoorskachel_kunden_auf.png";
        private const string url_projekte_auf = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_auf.png";


        private const string url_kunde_Anlagenbau_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_kunden_anlagenbau_grau.png";
        private const string url_kunde_Elektroteknik_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_kunden_elektrotechnik_grau.png";
        private const string url_kunde_Maschinenbau_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_kunden_maschinenbau_grau.png";
        private const string url_kunde_Anlagenbau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_kunden_anlagenbau.png";
        private const string url_kunde_Elektroteknik = "~/_layouts/images/Viewdoxx3/viewdoorskachel_kunden_elektrotechnik.png";
        private const string url_kunde_Maschinenbau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_kunden_maschinenbau.png";
        private const string url_kunde_auf_Anlagenbau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_kunden_auf_anlagenbau.png";
        private const string url_kunde_auf_Elektroteknik = "~/_layouts/images/Viewdoxx3/viewdoorskachel_kunden_auf_elektrotechnik.png";
        private const string url_kunde_auf_Maschinenbau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_kunden_auf_maschinenbau.png";


        private const string url_prozess_management_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_prozesse_management_grau.png";
        private const string url_prozess_produktion_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_prozesse_produktion_grau.png";
        private const string url_prozess_marketing_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_prozesse_marketing_grau.png";
        private const string url_prozess_support_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_prozesse_support_grau.png";
        private const string url_prozess_vertrieb_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_prozesse_vertrieb_grau.png";
        private const string url_prozess_management = "~/_layouts/images/Viewdoxx3/viewdoorskachel_prozesse_management.png";
        private const string url_prozess_produktion = "~/_layouts/images/Viewdoxx3/viewdoorskachel_prozesse_produktion.png";
        private const string url_prozess_marketing = "~/_layouts/images/Viewdoxx3/viewdoorskachel_prozesse_marketing.png";
        private const string url_prozess_support = "~/_layouts/images/Viewdoxx3/viewdoorskachel_prozesse_support.png";
        private const string url_prozess_vertrieb = "~/_layouts/images/Viewdoxx3/viewdoorskachel_prozesse_vertrieb.png";
        private const string url_prozess_auf_management = "~/_layouts/images/Viewdoxx3/viewdoorskachel_prozesse_auf_management.png";
        private const string url_prozess_auf_produktion = "~/_layouts/images/Viewdoxx3/viewdoorskachel_prozesse_auf_produktion.png";
        private const string url_prozess_auf_marketing = "~/_layouts/images/Viewdoxx3/viewdoorskachel_prozesse_auf_marketing.png";
        private const string url_prozess_auf_support = "~/_layouts/images/Viewdoxx3/viewdoorskachel_prozesse_auf_support.png";
        private const string url_prozess_auf_vertrieb = "~/_layouts/images/Viewdoxx3/viewdoorskachel_prozesse_auf_vertrieb.png";

        private const string url_produkt1_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_produkte_kat1_grau.png";
        private const string url_produkt2_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_produkte_kat2_grau.png";
        private const string url_produkt3_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_produkte_kat3_grau.png";
        private const string url_produkt4_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_produkte_kat4_grau.png";
        private const string url_produkt1 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_produkte_kat1.png";
        private const string url_produkt2 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_produkte_kat2.png";
        private const string url_produkt3 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_produkte_kat3.png";
        private const string url_produkt4 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_produkte_kat4.png";
        private const string url_produkt1_auf = "~/_layouts/images/Viewdoxx3/viewdoorskachel_produkte_auf_kat1.png";
        private const string url_produkt2_auf = "~/_layouts/images/Viewdoxx3/viewdoorskachel_produkte_auf_kat2.png";
        private const string url_produkt3_auf = "~/_layouts/images/Viewdoxx3/viewdoorskachel_produkte_auf_kat3.png";
        private const string url_produkt4_auf = "~/_layouts/images/Viewdoxx3/viewdoorskachel_produkte_auf_kat4.png";

        private const string url_projekte_1_100_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_1_100_grau.png";
        private const string url_projekte_1_500_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_1_500_grau.png";
        private const string url_projekte_101_200_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_101_200_grau.png";
        private const string url_projekte_201_300_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_201_300_grau.png";
        private const string url_projekte_301_400_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_301_400_grau.png";
        private const string url_projekte_401_500_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_401_500_grau.png";
        private const string url_projekte_501_1000_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_501_1000.png";
        private const string url_projekte_1001_1500_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_1001_1500.png";
        private const string url_projekte_1501_2000_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_1501_2000.png";
        private const string url_projekte_2001_2500_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_2001_2500.png";
        private const string url_projekte_20_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_20_grau.png";
        private const string url_projekte_121_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_121_grau.png";
        private const string url_projekte_123_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_123_grau.png";
        private const string url_projekte_154_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_154_grau.png";
        private const string url_projekte_156_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_156_grau.png";
        private const string url_projekte_188_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_188_grau.png";
        private const string url_projekte_189_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_189_grau.png";
        private const string url_projekte_190_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_190_grau.png";
        private const string url_projekte_1999_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_1999_grau.png";
        private const string url_projekte_2000_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_2000_grau.png";
        private const string url_projekte_2001_grau = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_2001_grau.png";
        private const string url_projekte_1_100 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_1_100.png";
        private const string url_projekte_1_500 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_1_500.png";
        private const string url_projekte_101_200 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_101_200.png";
        private const string url_projekte_201_300 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_201_300.png";
        private const string url_projekte_301_400 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_301_400.png";
        private const string url_projekte_401_500 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_401_500.png";
        private const string url_projekte_501_1000 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_501_1000.png";
        private const string url_projekte_1001_1500 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_1001_1500.png";
        private const string url_projekte_1501_2000 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_1501_2000.png";
        private const string url_projekte_2001_2500 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_2001_2500.png";
        private const string url_projekte_20 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_20.png";
        private const string url_projekte_121 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_121.png";
        private const string url_projekte_123 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_123.png";
        private const string url_projekte_154 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_154.png";
        private const string url_projekte_156 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_156.png";
        private const string url_projekte_188 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_188.png";
        private const string url_projekte_189 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_189.png";
        private const string url_projekte_190 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_190.png";
        private const string url_projekte_1999 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_1999.png";
        private const string url_projekte_2000 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_2000.png";
        private const string url_projekte_2001 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_2001.png";
        private const string url_projekte_auf_1_100 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_auf_1_100.png";
        private const string url_projekte_auf_1_500 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_auf_1_500.png";
        private const string url_projekte_auf_101_200 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_auf_101_200.png";
        private const string url_projekte_auf_201_300 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_auf_201_300.png";
        private const string url_projekte_auf_301_400 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_auf_301_400.png";
        private const string url_projekte_auf_401_500 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_auf_401_500.png";
        private const string url_projekte_auf_501_1000 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_auf_501_1000.png";
        private const string url_projekte_auf_1001_1500 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_auf_1001_1500.png";
        private const string url_projekte_auf_1501_2000 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_auf_1501_2000.png";
        private const string url_projekte_auf_2001_2500 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_auf_2001_2500.png";
        private const string url_projekte_auf_20 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_auf_20.png";
        private const string url_projekte_auf_121 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_auf_121.png";
        private const string url_projekte_auf_123 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_auf_123.png";
        private const string url_projekte_auf_154 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_auf_154.png";
        private const string url_projekte_auf_156 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_auf_156.png";
        private const string url_projekte_auf_188 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_auf_188.png";
        private const string url_projekte_auf_189 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_auf_189.png";
        private const string url_projekte_auf_190 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_auf_190.png";
        private const string url_projekte_auf_1999 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_auf_1999.png";
        private const string url_projekte_auf_2000 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_auf_2000.png";
        private const string url_projekte_auf_2001 = "~/_layouts/images/Viewdoxx3/viewdoorskachel_projekte_auf_2001.png";

        private const string url_schubladen_marketing = "~/_layouts/images/Viewdoxx3/viewdoorskachel_schubladen_marketing.png";
        private const string url_schubladen_marketing_kunden = "~/_layouts/images/Viewdoxx3/viewdoorskachel_schubladen_marketing_kunden.png";
        private const string url_schubladen_marketing_produkte = "~/_layouts/images/Viewdoxx3/viewdoorskachel_schubladen_marketing_produkte.png";
        private const string url_schubladen_marketing_prozesse = "~/_layouts/images/Viewdoxx3/viewdoorskachel_schubladen_marketing_prozesse.png";
        private const string url_schubladen_marketing_projekte = "~/_layouts/images/Viewdoxx3/viewdoorskachel_schubladen_marketing_projekte.png";
        private const string url_schubladen_produktion = "~/_layouts/images/Viewdoxx3/viewdoorskachel_schubladen_produktion.png";
        private const string url_schubladen_produktion_kunden = "~/_layouts/images/Viewdoxx3/viewdoorskachel_schubladen_produktion_kunden.png";
        private const string url_schubladen_produktion_produkte = "~/_layouts/images/Viewdoxx3/viewdoorskachel_schubladen_produktion_produkte.png";
        private const string url_schubladen_produktion_prozesse = "~/_layouts/images/Viewdoxx3/viewdoorskachel_schubladen_produktion_prozesse.png";
        private const string url_schubladen_produktion_projekte = "~/_layouts/images/Viewdoxx3/viewdoorskachel_schubladen_produktion_projekte.png";
        private const string url_schubladen_projekte = "~/_layouts/images/Viewdoxx3/viewdoorskachel_schubladen_projekte.png";
        private const string url_schubladen_projekte_kunden = "~/_layouts/images/Viewdoxx3/viewdoorskachel_schubladen_projekt_kunden.png";
        private const string url_schubladen_projekte_produkte = "~/_layouts/images/Viewdoxx3/viewdoorskachel_schubladen_projekt_produkte.png";
        private const string url_schubladen_projekte_prozesse = "~/_layouts/images/Viewdoxx3/viewdoorskachel_schubladen_projekt_prozesse.png";
        private const string url_schubladen_projekte_projekte = "~/_layouts/images/Viewdoxx3/viewdoorskachel_schubladen_projekt_projekte.png";
        private const string url_schubladen_qualitaet = "~/_layouts/images/Viewdoxx3/viewdoorskachel_schubladen_qualität.png";
        private const string url_schubladen_qualitaet_kunden = "~/_layouts/images/Viewdoxx3/viewdoorskachel_schubladen_qualität_kunden.png";
        private const string url_schubladen_qualitaet_produkte = "~/_layouts/images/Viewdoxx3/viewdoorskachel_schubladen_qualität_produkte.png";
        private const string url_schubladen_qualitaet_prozesse = "~/_layouts/images/Viewdoxx3/viewdoorskachel_schubladen_qualität_prozesse.png";
        private const string url_schubladen_qualitaet_projekte = "~/_layouts/images/Viewdoxx3/viewdoorskachel_schubladen_qualität_projekte.png"; 

        #endregion

        #region attribute CAML for Dokumentkategorie

        private const string dok_kat_marketing = "<Contains><FieldRef Name='Dokumentkategorie' /><Value Type='TaxonomyFieldTypeMulti'>Marketingdokumente</Value></Contains>";
        private const string dok_kat_produktion = "<Contains><FieldRef Name='Dokumentkategorie' /><Value Type='TaxonomyFieldTypeMulti'>Produktionsdokumente</Value></Contains>";
        private const string dok_kat_projekt = "<Contains><FieldRef Name='Dokumentkategorie' /><Value Type='TaxonomyFieldTypeMulti'>Projektdokumente</Value></Contains>";
        private const string dok_kat_qualitaet = "<Contains><FieldRef Name='Dokumentkategorie' /><Value Type='TaxonomyFieldTypeMulti'>Qualitätsdokumente</Value></Contains>";
        private string group = String.Format("<Contains><FieldRef Name='Gruppen' /><Value Type='UserMulti'>{0}</Value></Contains>",SPContext.Current.Web.CurrentUser.Groups[0].ToString());

        #endregion

        #region methode

        protected void ProcessQuery(string caml)
        {
            Session["myQuery"] = caml;
            web = SPContext.Current.Web;
            list = web.Lists["Testbibliothek_Managed_Metadata"];
            //list = web.Lists["Viewdoxx Prototyp"];
            SPView nameView = list.Views["NameAnsicht"];
            query = new SPQuery(nameView);
            lvbq = new ListViewByQuery();
            lvbq.List = list;
            query.Query = caml;
            lvbq.Query = query;
            this.Controls.Add(lvbq);
        }

        protected string GetQueryByGroupName(string initQuery, string group)
        {
            string newQuery = String.Format("<Where><And>{0}{1}</And></Where>", RemoveWhereClause(initQuery), group);
            return newQuery;
        }

        protected string ExpandQuery(string initQuery, DokumentKategorie kategorie)
        {
            string newQuery = String.Empty;
            switch (kategorie)
            {
                case DokumentKategorie.Marketing:
                    newQuery = String.Format("<Where><And>{0}{1}</And></Where>", RemoveWhereClause(initQuery), dok_kat_marketing);
                    break;
                case DokumentKategorie.Produktion:
                    newQuery = String.Format("<Where><And>{0}{1}</And></Where>", RemoveWhereClause(initQuery), dok_kat_produktion);
                    break;
                case DokumentKategorie.Projekt:
                    newQuery = String.Format("<Where><And>{0}{1}</And></Where>", RemoveWhereClause(initQuery), dok_kat_projekt);
                    break;
                case DokumentKategorie.Qualitaet:
                    newQuery = String.Format("<Where><And>{0}{1}</And></Where>", RemoveWhereClause(initQuery), dok_kat_qualitaet);
                    break;
            }
            return newQuery;   
        }

        protected string RemoveWhereClause(string initQuery)
        {
            return initQuery.Replace("<Where>", String.Empty).Replace("</Where>", String.Empty);
        }

        protected void ShowDrawers()
        {
            panel_schubladen.Visible = true; 
            viewdoxx = (Viewdoxx) Session["viewdoxx"];
          
            switch(viewdoxx)
            {
                case Viewdoxx.Prozesse:
                    ShowProzessDrawer();
                    break; 
                case Viewdoxx.Kunden:
                    ShowKundeDrawer();
                    break; 
                case Viewdoxx.Produkte:
                    ShowProduktDrawer();
                    break;
                case Viewdoxx.Projekte:
                    ShowProjektDrawer();
                    break;
            }
        }


        private string RemoveDokumentKategorieString(string oldString, string dokumentkategorie)
        {
            if (oldString.Contains(dok_kat_marketing))
            {
                oldString = String.Format("<Where>{0}</Where>",oldString.Replace(String.Format("{0}</And></Where>",dok_kat_marketing), String.Empty).Replace("<Where><And>", String.Empty));
            }
            if (oldString.Contains(dok_kat_produktion))
            {
                oldString = String.Format("<Where>{0}</Where>", oldString.Replace(String.Format("{0}</And></Where>", dok_kat_produktion), String.Empty).Replace("<Where><And>", String.Empty));
            }
            if (oldString.Contains(dok_kat_projekt))
            {
                oldString = String.Format("<Where>{0}</Where>", oldString.Replace(String.Format("{0}</And></Where>", dok_kat_projekt), String.Empty).Replace("<Where><And>", String.Empty));
            }
            if (oldString.Contains(dok_kat_qualitaet))
            {
                //oldString = oldString.Replace(dok_kat_qualitaet, String.Empty).Replace("<And>", String.Empty).Replace("</And>", String.Empty);
                oldString = String.Format("<Where>{0}</Where>", oldString.Replace(String.Format("{0}</And></Where>", dok_kat_qualitaet), String.Empty).Replace("<Where><And>", String.Empty));
            }
            return oldString;
        }


        private void ShowProjektDrawer()
        {
            img_schubladen_marketing.ImageUrl = url_schubladen_marketing_projekte;
            img_schubladen_produktion.ImageUrl = url_schubladen_produktion_projekte;
            img_schubladen_projekt.ImageUrl = url_schubladen_projekte_projekte;
            img_schubladen_qualitaet.ImageUrl = url_schubladen_qualitaet_projekte;
        }

        private void ShowProduktDrawer()
        {
            img_schubladen_marketing.ImageUrl = url_schubladen_marketing_produkte;
            img_schubladen_produktion.ImageUrl = url_schubladen_produktion_produkte;
            img_schubladen_projekt.ImageUrl = url_schubladen_projekte_produkte;
            img_schubladen_qualitaet.ImageUrl = url_schubladen_qualitaet_produkte;
        }

        private void ShowKundeDrawer()
        {
            img_schubladen_marketing.ImageUrl = url_schubladen_marketing_kunden;
            img_schubladen_produktion.ImageUrl = url_schubladen_produktion_kunden;
            img_schubladen_projekt.ImageUrl = url_schubladen_projekte_kunden;
            img_schubladen_qualitaet.ImageUrl = url_schubladen_qualitaet_kunden;
        }

        private void ShowProzessDrawer()
        {
            img_schubladen_marketing.ImageUrl = url_schubladen_marketing_prozesse;
            img_schubladen_produktion.ImageUrl = url_schubladen_produktion_prozesse;
            img_schubladen_projekt.ImageUrl = url_schubladen_projekte_prozesse;
            img_schubladen_qualitaet.ImageUrl = url_schubladen_qualitaet_prozesse;
        }

        private void CloseAllPanels()
        {
            panel_kunde.Visible = false;
            panel_produkte.Visible = false;
            panel_prozess.Visible = false;
            panel_schubladen.Visible = false;
            CloseProjektPanel();
        }

        private void CloseProjektPanel()
        {
            CloseProjektPanelLevel1();
            CloseProjektPanelLevel2();
            CloseProjektPanelLevel3();
        }

        private void CloseProjektPanelLevel1()
        {
            panel_projekte_1_1000.Visible = false;
            panel_schubladen.Visible = false;
        }

        private void CloseProjektPanelLevel2()
        {
            panel_projekte_1_500.Visible = false;
            panel_projekte_1501_2000.Visible = false;
            panel_projekte_2001_2500.Visible = false;
            panel_schubladen.Visible = false;
        }

        private void CloseProjektPanelLevel3()
        {
            panel_projekte_1_100.Visible = false;
            panel_projekte_100_200.Visible = false;
            panel_schubladen.Visible = false;
        }

        private void CloseAllImages()
        {
            CloseMainDoorImages();
            CloseKundeImages();
            CloseProduktImages();
            CloseProjektImages();
            CloseProzessImages();
        }

        private void CloseMainDoorImages()
        {
            btn_kunden.ImageUrl = url_kunde_grau;
            btn_produkte.ImageUrl = url_produkt_grau;
            btn_prozesse.ImageUrl = url_prozess_grau;
            btn_projekte.ImageUrl = url_projekte_grau;
        }

        private void CloseKundeImages()
        {
            img_kunde_Anlagenbau.ImageUrl = url_kunde_Anlagenbau;
            img_kunde_Elektroteknik.ImageUrl = url_kunde_Elektroteknik;
            img_kunde_Maschinenbau.ImageUrl = url_kunde_Maschinenbau;
        }

        private void CloseProzessImages()
        {
            img_prozess_management.ImageUrl = url_prozess_management;
            img_prozess_produktions.ImageUrl = url_prozess_produktion;
            img_prozess_marketing.ImageUrl = url_prozess_marketing;
            img_prozess_support.ImageUrl = url_prozess_support;
            img_prozess_vertrieb.ImageUrl = url_prozess_vertrieb;
        }

        private void CloseProduktImages()
        {
            img_produkt1.ImageUrl = url_produkt1;
            img_produkt2.ImageUrl = url_produkt2;
            img_produkt3.ImageUrl = url_produkt3;
            img_produkt4.ImageUrl = url_produkt4;

        }

        private void CloseProjektImages()
        {
            img_projekt_121.ImageUrl = url_projekte_121;
            img_projekt_123.ImageUrl = url_projekte_123;
            img_projekt_154.ImageUrl = url_projekte_154;
            img_projekt_156.ImageUrl = url_projekte_156;
            img_projekt_188.ImageUrl = url_projekte_188;
            img_projekt_189.ImageUrl = url_projekte_189;
            img_projekt_190.ImageUrl = url_projekte_190;
            img_projekt_2000.ImageUrl = url_projekte_2000;
            img_projekt_2001.ImageUrl = url_projekte_2001;
            img_projekt_1999.ImageUrl = url_projekte_1999;
            img_projekt_go500.ImageUrl = url_projekte_1_500_grau;
            img_projekt_go1000.ImageUrl = url_projekte_501_1000;
            img_projekt_go1500.ImageUrl = url_projekte_1001_1500;
            img_projekt_go2000.ImageUrl = url_projekte_1501_2000;
            img_projekt_go2500.ImageUrl = url_projekte_2001_2500;
            img_projekt_to100.ImageUrl = url_projekte_1_100;
            img_projekt_to200.ImageUrl = url_projekte_101_200;
            img_projekt_to300.ImageUrl = url_projekte_201_300;
            img_projekt_to400.ImageUrl = url_projekte_301_400;
            img_projekt_to500.ImageUrl = url_projekte_401_500;
        }

        #endregion

        #region Event Handler

        protected void btn_viewgle_Click(object sender, ImageClickEventArgs e)
        {
            if (btn_viewgle.ImageUrl == url_viewgle_grau)
            {
                btn_viewgle.ImageUrl = url_viewgle_auf;
                btn_kunden.Visible = true;
                btn_produkte.Visible = true;
                btn_projekte.Visible = true;
                btn_prozesse.Visible = true;
            }
            else
            {
                CloseAllImages();
                CloseAllPanels();
                btn_viewgle.ImageUrl = url_viewgle_grau;
                btn_kunden.Visible = false;
                btn_produkte.Visible = false;
                btn_projekte.Visible = false;
                btn_prozesse.Visible = false;
            }
        }




        #region projekt

        protected void btn_projekte_Click(object sender, ImageClickEventArgs e)
        {
            CloseAllImages();
            CloseAllPanels();
            CloseProjektImages();
            btn_projekte.ImageUrl = url_projekte_auf;
            panel_projekte_1_1000.Visible = true;
            viewdoxx = Viewdoxx.Projekte;
            Session["viewdoxx"] = viewdoxx;
            myQuery = "<Where><IsNotNull><FieldRef Name='Projektnummer'/></IsNotNull></Where>";
            ProcessQuery(myQuery);

        }

        protected void img_projekt_go500_Click(object sender, ImageClickEventArgs e)
        {
            CloseProjektImages();
            CloseProjektPanelLevel2();
            CloseProjektPanelLevel3();
            panel_projekte_1_500.Visible = true;
            img_projekt_go500.ImageUrl = url_projekte_auf_1_500;
            myQuery = "<Where><And><Geq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>1</Value></Geq><Leq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>500</Value></Leq></And></Where>";
            ProcessQuery(myQuery);
        }

        protected void img_projekt_go1000_Click(object sender, ImageClickEventArgs e)
        {
            CloseProjektImages();
            CloseProjektPanelLevel2();
            CloseProjektPanelLevel3();
            img_projekt_go1000.ImageUrl = url_projekte_auf_501_1000;
            myQuery = "<Where><And><Geq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>501</Value></Geq><Leq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>1000</Value></Leq></And></Where>";
            ProcessQuery(myQuery);
        }

        protected void img_projekt_go1500_Click(object sender, ImageClickEventArgs e)
        {
            CloseProjektImages();
            CloseProjektPanelLevel2();
            CloseProjektPanelLevel3();
            img_projekt_go1500.ImageUrl = url_projekte_auf_1001_1500;
            myQuery = "<Where><And><Geq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>1001</Value></Geq><Leq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>1500</Value></Leq></And></Where>";
            ProcessQuery(myQuery);
        }

        protected void img_projekt_go2000_Click(object sender, ImageClickEventArgs e)
        {
            CloseProjektImages();
            CloseProjektPanelLevel2();
            CloseProjektPanelLevel3();
            panel_projekte_1501_2000.Visible = true;
            img_projekt_go2000.ImageUrl = url_projekte_auf_1501_2000;
            myQuery = "<Where><And><Geq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>1501</Value></Geq><Leq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>2000</Value></Leq></And></Where>";
            ProcessQuery(myQuery);
        }

        protected void img_projekt_go2500_Click(object sender, ImageClickEventArgs e)
        {
            CloseProjektImages();
            CloseProjektPanelLevel2();
            CloseProjektPanelLevel3();
            panel_projekte_2001_2500.Visible = true;
            img_projekt_go2500.ImageUrl = url_projekte_auf_2001_2500;
            myQuery = "<Where><And><Geq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>2001</Value></Geq><Leq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>2500</Value></Leq></And></Where>";
            ProcessQuery(myQuery);
        }



        protected void img_projekt_to100_Click(object sender, ImageClickEventArgs e)
        {
            CloseProjektImages();
            CloseProjektPanelLevel3();
            panel_projekte_1_100.Visible = true;
            img_projekt_to100.ImageUrl = url_projekte_auf_1_100;
            myQuery = "<Where><And><Geq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>1</Value></Geq><Leq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>100</Value></Leq></And></Where>";
            ProcessQuery(myQuery);
        }

        protected void img_projekt_to200_Click(object sender, ImageClickEventArgs e)
        {
            CloseProjektImages();
            CloseProjektPanelLevel3();
            panel_projekte_100_200.Visible = true;
            img_projekt_to200.ImageUrl = url_projekte_auf_101_200;
            myQuery = "<Where><And><Geq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>101</Value></Geq><Leq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>200</Value></Leq></And></Where>";
            ProcessQuery(myQuery);
        }

        protected void img_projekt_to300_Click(object sender, ImageClickEventArgs e)
        {
            CloseProjektImages();
            CloseProjektPanelLevel3();
            img_projekt_to300.ImageUrl = url_projekte_auf_201_300;
            myQuery = "<Where><And><Geq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>201</Value></Geq><Leq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>300</Value></Leq></And></Where>";
            ProcessQuery(myQuery);
        }

        protected void img_projekt_to400_Click(object sender, ImageClickEventArgs e)
        {
            CloseProjektImages();
            CloseProjektPanelLevel3();
            img_projekt_to400.ImageUrl = url_projekte_auf_301_400;
            myQuery = "<Where><And><Geq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>301</Value></Geq><Leq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>400</Value></Leq></And></Where>";
            ProcessQuery(myQuery);
        }

        protected void img_projekt_to500_Click(object sender, ImageClickEventArgs e)
        {
            CloseProjektImages();
            CloseProjektPanelLevel3();
            img_projekt_to500.ImageUrl = url_projekte_auf_401_500;
            myQuery = "<Where><And><Geq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>401</Value></Geq><Leq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>500</Value></Leq></And></Where>";
            ProcessQuery(myQuery);
        }


        protected void Img_Projekt_20_Click(object sender, ImageClickEventArgs e)
        {
            CloseProjektPanelLevel3();
            CloseProjektImages();
            panel_projekte_1_100.Visible = true;
            img_projekt_20.ImageUrl = url_projekte_auf_20;
            myQuery = "<Where><Eq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>20</Value></Eq></Where>";
            ProcessQuery(myQuery);
            ShowDrawers();
        }

        protected void img_projekt123_Click(object sender, ImageClickEventArgs e)
        {
            CloseProjektPanelLevel3();
            CloseProjektImages();
            panel_projekte_100_200.Visible = true;
            img_projekt_123.ImageUrl = url_projekte_auf_123;
            myQuery = "<Where><Eq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>123</Value></Eq></Where>";
            ProcessQuery(myQuery);
            ShowDrawers();
        }

        protected void Img_Projekt_121_Click(object sender, ImageClickEventArgs e)
        {
            CloseProjektPanelLevel3();
            CloseProjektImages();
            panel_projekte_100_200.Visible = true;
            img_projekt_121.ImageUrl = url_projekte_auf_121;
            myQuery = "<Where><Eq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>121</Value></Eq></Where>";
            ProcessQuery(myQuery);
            ShowDrawers();
        }

        protected void Img_Projekt_154_Click(object sender, ImageClickEventArgs e)
        {
            CloseProjektPanelLevel3();
            CloseProjektImages();
            panel_projekte_100_200.Visible = true;
            img_projekt_154.ImageUrl = url_projekte_auf_154;
            myQuery = "<Where><Eq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>154</Value></Eq></Where>";
            ProcessQuery(myQuery);
            ShowDrawers();
        }

        protected void Img_Projekt_156_Click(object sender, ImageClickEventArgs e)
        {
            CloseProjektPanelLevel3();
            CloseProjektImages();
            panel_projekte_100_200.Visible = true;
            img_projekt_156.ImageUrl = url_projekte_auf_156;
            myQuery = "<Where><Eq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>156</Value></Eq></Where>";
            ProcessQuery(myQuery);
            ShowDrawers();
        }

        protected void Img_Projekt_188_Click(object sender, ImageClickEventArgs e)
        {
            CloseProjektPanelLevel3();
            CloseProjektImages();
            panel_projekte_100_200.Visible = true;
            img_projekt_188.ImageUrl = url_projekte_auf_188;
            myQuery = "<Where><Eq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>188</Value></Eq></Where>";
            ProcessQuery(myQuery);
            ShowDrawers();
        }

        protected void Img_Projekt_189_Click(object sender, ImageClickEventArgs e)
        {
            CloseProjektPanelLevel3();
            CloseProjektImages();
            panel_projekte_100_200.Visible = true;
            img_projekt_189.ImageUrl = url_projekte_auf_189;
            myQuery = "<Where><Eq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>189</Value></Eq></Where>";
            ProcessQuery(myQuery);
            ShowDrawers();
        }

        protected void Img_Projekt_190_Click(object sender, ImageClickEventArgs e)
        {
            CloseProjektPanelLevel3();
            CloseProjektImages();
            panel_projekte_100_200.Visible = true;
            img_projekt_190.ImageUrl = url_projekte_auf_190;
            myQuery = "<Where><Eq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>190</Value></Eq></Where>";
            ProcessQuery(myQuery);
            ShowDrawers();
        }

        protected void Img_Projekt_1999_Click(object sender, ImageClickEventArgs e)
        {
            CloseProjektPanelLevel3();
            CloseProjektImages();
            img_projekt_1999.ImageUrl = url_projekte_auf_1999;
            myQuery = "<Where><Eq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>1999</Value></Eq></Where>";
            ProcessQuery(myQuery);
            ShowDrawers();
        }


        protected void Img_Projekt_2000_Click(object sender, ImageClickEventArgs e)
        {
            CloseProjektPanelLevel3();
            CloseProjektImages();
            img_projekt_2000.ImageUrl = url_projekte_auf_2000;
            myQuery = "<Where><Eq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>2000</Value></Eq></Where>";
            ProcessQuery(myQuery);
            ShowDrawers();
        }

        protected void Img_Projekt_2001_Click(object sender, ImageClickEventArgs e)
        {
            CloseProjektPanelLevel3();
            CloseProjektImages();
            img_projekt_2001.ImageUrl = url_projekte_auf_2001;
            myQuery = "<Where><Eq><FieldRef Name='Projektnummer' /><Value Type='TaxonomyFieldTypeMulti'>2001</Value></Eq></Where>";
            ProcessQuery(myQuery);
            ShowDrawers();
        }



        #endregion

        #region kunde

        protected void btn_kunden_Click(object sender, ImageClickEventArgs e)
        {
            CloseAllImages();
            CloseAllPanels();
            CloseKundeImages();
            btn_kunden.ImageUrl = url_kunde_auf;
            panel_kunde.Visible = true;
            viewdoxx = Viewdoxx.Kunden;
            Session["viewdoxx"] = viewdoxx;
            myQuery = "<Where><IsNotNull><FieldRef Name='Kunde'/></IsNotNull></Where>";
            ProcessQuery(GetQueryByGroupName(myQuery, group));
        }


        protected void img_kunde_Anlagenbau_Click(object sender, ImageClickEventArgs e)
        {
            CloseKundeImages();
            img_kunde_Anlagenbau.ImageUrl = url_kunde_auf_Anlagenbau;
            myQuery = "<Where><Eq><FieldRef Name='Kunde' /><Value Type='TaxonomyFieldTypeMulti'>Firma Anlagenbau</Value></Eq></Where>";
            ProcessQuery(GetQueryByGroupName(myQuery, group));
            ShowDrawers();
        }


        protected void img_kunde_Elektroteknik_Click(object sender, ImageClickEventArgs e)
        {
            CloseKundeImages();
            img_kunde_Elektroteknik.ImageUrl = url_kunde_auf_Elektroteknik;
            myQuery = "<Where><Eq><FieldRef Name='Kunde' /><Value Type='TaxonomyFieldTypeMulti'>Firma Elektrotechnik</Value></Eq></Where>";
            ProcessQuery(GetQueryByGroupName(myQuery, group));
            ShowDrawers();
        }

        protected void img_kunde_Maschinenbau_Click(object sender, ImageClickEventArgs e)
        {
            CloseKundeImages();
            img_kunde_Maschinenbau.ImageUrl = url_kunde_auf_Maschinenbau;
            myQuery = "<Where><Eq><FieldRef Name='Kunde' /><Value Type='TaxonomyFieldTypeMulti'>Firma Maschinenbau</Value></Eq></Where>";
            ProcessQuery(GetQueryByGroupName(myQuery, group));
            ShowDrawers();
        }

        #endregion

        #region produkt

        protected void btn_produkte_Click(object sender, ImageClickEventArgs e)
        {
            CloseAllImages();
            CloseAllPanels();
            CloseProduktImages();
            btn_produkte.ImageUrl = url_produkt_auf;
            panel_produkte.Visible = true;
            viewdoxx = Viewdoxx.Produkte;
            Session["viewdoxx"] = viewdoxx;
            myQuery = " <Where><IsNotNull> <FieldRef Name='Produktkategorie' /></IsNotNull></Where>";
            ProcessQuery(GetQueryByGroupName(myQuery, group));
        }

        protected void img_produktA_Click(object sender, ImageClickEventArgs e)
        {
            CloseProduktImages();
            img_produkt1.ImageUrl = url_produkt1_auf;
            myQuery = "<Where><Eq><FieldRef Name='Produktkategorie' /><Value Type='TaxonomyFieldTypeMulti'>Produktkategorie 1</Value></Eq></Where>";
            ProcessQuery(GetQueryByGroupName(myQuery, group));
            ShowDrawers();
        }

        protected void img_produktB_Click(object sender, ImageClickEventArgs e)
        {
            CloseProduktImages();
            img_produkt2.ImageUrl = url_produkt2_auf;
            myQuery = "<Where><Eq><FieldRef Name='Produktkategorie' /><Value Type='TaxonomyFieldTypeMulti'>Produktkategorie 2</Value></Eq></Where>";
            ProcessQuery(GetQueryByGroupName(myQuery, group));
            ShowDrawers();
        }

        protected void img_produktC_Click(object sender, ImageClickEventArgs e)
        {
            CloseProduktImages();
            img_produkt3.ImageUrl = url_produkt3_auf;
            myQuery = "<Where><Eq><FieldRef Name='Produktkategorie' /><Value Type='TaxonomyFieldTypeMulti'>Produktkategorie 3</Value></Eq></Where>";
            ProcessQuery(GetQueryByGroupName(myQuery, group));
            ShowDrawers();
        }

        protected void img_produktD_Click(object sender, ImageClickEventArgs e)
        {
            CloseProduktImages();
            img_produkt4.ImageUrl = url_produkt4_auf;
            myQuery = "<Where><Eq><FieldRef Name='Produktkategorie' /><Value Type='TaxonomyFieldTypeMulti'>Produktkategorie 4</Value></Eq></Where>";
            ProcessQuery(GetQueryByGroupName(myQuery,group));
            ShowDrawers();
        }

        #endregion

        #region prozess

        protected void btn_prozesse_Click(object sender, ImageClickEventArgs e)
        {
            CloseAllImages();
            CloseAllPanels();
            CloseProzessImages();
            btn_prozesse.ImageUrl = url_prozess_auf;
            panel_prozess.Visible = true;
            viewdoxx = Viewdoxx.Prozesse;
            Session["viewdoxx"] = viewdoxx;
            myQuery = "<Where><IsNotNull><FieldRef Name='Prozess'/></IsNotNull></Where>";
            ProcessQuery(GetQueryByGroupName(myQuery, group));
        }



        protected void img_management_Click(object sender, ImageClickEventArgs e)
        {
            CloseProzessImages();
            img_prozess_management.ImageUrl = url_prozess_auf_management;
            myQuery = " <Where><Eq><FieldRef Name='Prozess' /><Value Type='TaxonomyFieldTypeMulti'>management</Value></Eq></Where>";
            ProcessQuery(GetQueryByGroupName(myQuery, group));
            ShowDrawers();
            
        }

        protected void img_prozess_marketing_Click(object sender, ImageClickEventArgs e)
        {
            CloseProzessImages();
            img_prozess_marketing.ImageUrl = url_prozess_auf_marketing;
            myQuery = " <Where><Eq><FieldRef Name='Prozess' /><Value Type='TaxonomyFieldTypeMulti'>marketing</Value></Eq></Where>";
            ProcessQuery(GetQueryByGroupName(myQuery, group));
            ShowDrawers();
        }

        protected void img_prozess_produktions_Click(object sender, ImageClickEventArgs e)
        {
            CloseProzessImages();
            img_prozess_produktions.ImageUrl = url_prozess_auf_produktion;
            myQuery = " <Where><Eq><FieldRef Name='Prozess' /><Value Type='TaxonomyFieldTypeMulti'>produktion</Value></Eq></Where>";
            ProcessQuery(GetQueryByGroupName(myQuery, group));
            ShowDrawers();
        }

        protected void img_prozess_support_Click(object sender, ImageClickEventArgs e)
        {
            CloseProzessImages();
            img_prozess_support.ImageUrl = url_prozess_auf_support;
            myQuery = " <Where><Eq><FieldRef Name='Prozess' /><Value Type='TaxonomyFieldTypeMulti'>support</Value></Eq></Where>";
            ProcessQuery(GetQueryByGroupName(myQuery, group));
            ShowDrawers();
        }

        protected void img_prozess_vertrieb_Click(object sender, ImageClickEventArgs e)
        {
            CloseProzessImages();
            img_prozess_vertrieb.ImageUrl = url_prozess_auf_vertrieb;
            myQuery = " <Where><Eq><FieldRef Name='Prozess' /><Value Type='TaxonomyFieldTypeMulti'>vertrieb</Value></Eq></Where>";
            ProcessQuery(GetQueryByGroupName(myQuery, group));
            ShowDrawers();
        }




        #endregion

        #region schubladen

        protected void img_schubladen_marketing_Click(object sender, ImageClickEventArgs e)
        {
            myQuery = RemoveDokumentKategorieString(Session["myQuery"].ToString(), dok_kat_marketing);
            string newQuery = ExpandQuery(myQuery, DokumentKategorie.Marketing);
            ProcessQuery(newQuery);
        }

        protected void img_schubladen_projekt_Click(object sender, ImageClickEventArgs e)
        {
            myQuery = RemoveDokumentKategorieString(Session["myQuery"].ToString(), dok_kat_projekt);
            string newQuery = ExpandQuery(myQuery, DokumentKategorie.Projekt);
            ProcessQuery(newQuery);
        }

        protected void img_schubladen_qualitaet_Click(object sender, ImageClickEventArgs e)
        {
            myQuery = RemoveDokumentKategorieString(Session["myQuery"].ToString(), dok_kat_qualitaet);
            string newQuery = ExpandQuery(myQuery, DokumentKategorie.Qualitaet);
            ProcessQuery(newQuery);
        }

        protected void img_schubladen_produktion_Click(object sender, ImageClickEventArgs e)
        {
            myQuery = RemoveDokumentKategorieString(Session["myQuery"].ToString(), dok_kat_produktion);
            string newQuery = ExpandQuery(myQuery, DokumentKategorie.Produktion);
            ProcessQuery(newQuery);
        }
 
        
        #endregion

        #endregion





    }
}
